package com.huatai.paas.controller;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.huatai.common.api.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

/**
 * 视频管理
 */
@Api(tags = "视频管理")
@RestController
@RequestMapping(value = "/video")
public class VideoController {
	private static final Logger logger = LoggerFactory.getLogger(VideoController.class);

	@ApiOperation("查询视频数据列表")
	@PostMapping("/list")
	public R getVideoList(){
		JSONArray jsonArray = new JSONArray();
		JSONObject obj = new JSONObject();
		obj.put("id", 1);
		obj.put("name", "测试");
		obj.put("url", "www.baidu.com");
		jsonArray.add(obj);
		return R.data(jsonArray);
	}

	@ApiOperation("获取视频数据详情")
	@PostMapping("/detail/{videoId}")
	public R getVideoDetail(@PathVariable("videoId") Long videoId){
		JSONObject obj = new JSONObject();
		obj.put("id", 1);
		obj.put("name", "测试");
		obj.put("url", "www.baidu.com");
		return R.data(obj);
	}

}
